<?php
/**
 * 商品导出字段
 */

namespace Beike\Admin\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ProductSkusExportSimple extends JsonResource
{
    public function toArray($request): array
    {
        $data = [
//            'remark'                => $this->product_id . "--" . $this->id,
            'imagen'                => $this->image?image_resize($this->image):"",
            'product_description'   => $this->description->name,
            'precio'                => currency_format($this->price),
            'quantity'              => $this->quantity,
            'total'                 => currency_format($this->price * $this->quantity),
//            'sku'                   => $this->sku,
        ];

        return hook_filter('resource.product.export.simple', $data);
    }
}
